<template>
	<view class="xcxzdsfgrtrt">

	</view>
	<view class="pr pd pt20">

		<view class="display-flex mt20" v-for="sd in list">
			<view class="zcxdvsdrty">
				<frImage :src="sd.headPortrait" class="w100 h100" ></frImage>
			</view>
			<view class=" flex-1 ml20 bbm pm20">
				<view class="fz32 red display-flex">
					<view class=" dian sdfdsfdsertry">
						{{sd.nickname}}
					</view>
					<view class="vertical-center ml10">
						
							<image :src="sd.xqicon" mode="widthFix" class="dxcdcerewwert cz"></image>
						
					</view>
					<view class="fz24 z9 ml10 vertical-center">
						{{sd.xqtext}}

					</view>
				</view>
				<view class="z3 fz32 mt20 tlddq">
					{{sd.title}}
				</view>
				<view class="dfdsfrttt mt20">
					<view class="" v-for="(sa,idx) in sd.imgList" @tap="sdtrdfgt(sa,sd.imgList)">
						<view   class="xzcxzerfewrrt w100 cz">
							<frImage :src="sa" mode="aspectFill" class="w100 h100 cz"></frImage>
						</view>
						
					</view>
				</view>
				<view class="mt20 display-flex">
					<view class="flex-1 z9 fz22 vertical-center tl">
						{{timeFrom(sd.addTime)}}
					</view>
					<view class="fz28" @tap="dianzan(sd)">
						<text class="cz">{{sd.dzsl}}</text>
						<text class="iconfont icon-dianzan_kuai fz40 cz ml10 red" v-if="sd.sc"></text>
						<text class="iconfont icon-good fz40 cz ml10" v-else></text>

					</view>
				</view>
			</view>
		</view>

	</view>
</template>
<script lang="ts" setup>
	import { onLoad,onPullDownRefresh } from "@dcloudio/uni-app"
	import { ref } from "vue"
	import { hf, dxrequest, callBack, timeFrom } from "@/util/index.js"
	import frImage from "@/components/fr-image/fr-image.vue"
	const list = ref([])
	const initData = async () => {
		uni.showLoading({
			title: "加载中..."
		})
		const { data } = await dxrequest("maya/fenxiangList/fenxiangList", {
			page: 1,
			pageSize: 999
		})
		list.value = data.data
		uni.hideLoading()
	}
	onLoad(() => {
		initData()
	})
	onPullDownRefresh(async () => {
		initData()
		uni.stopPullDownRefresh();
	})
	const sdtrdfgt = (dsd, list) => {
		uni.previewImage({
			current: dsd,
			urls: list,

		})
	}
	const dianzan = async (sd) => {
		uni.showLoading({
			title:"操作中..."
		})
		const { data } = await dxrequest("maya/api/hjsdrere", { jid: sd.id }, "post")
		if (sd.sc) {
			sd.sc = false
			sd.dzsl = sd.dzsl-1
		} else {
			sd.sc= true
			sd.dzsl = sd.dzsl+1
		}
		uni.hideLoading()
	}
</script>

<style scoped>
	.zcxdvsdrty {
		width: 80rpx;
		height: 80rpx;
		border-radius: 50%;
	}

	.dxcdcerewwert {
		width: 32rpx;
		
	}

	.dfdsfrttt {
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		grid-template-rows: repeat(1, 1fr);
		grid-column-gap: 20rpx;
		grid-row-gap: 20rpx
	}

	.xzcxzerfewrrt {
		width: 100%;
		height: 180rpx;
	}

	.sdfdsfdsertry {
		max-width: 400rpx;
	}
</style>